import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../views/home/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/home/city",
    name: "City",
    component: () => import("../views/home/city/index.vue"),
    meta: { isShow: false },
  },
  {
    path: "/home/search",
    name: "Search",
    component: () => import("../views/home/search/index.vue"),
    meta: { isShow: false },
  },
  {
    path: "/brand",
    name: "Brand",
    component: () => import("../views/home/brand/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/brand/detailaction",
    name: "BrandDetail",
    component: () => import("../views/home/brand/brandDetail/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/new/newgoods",
    name: "Newgoods",
    component: () => import("../views/home/new/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/topic",
    name: "Topic",
    component: () => import("../views/topic/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/topic/detail",
    name: "TopicDetail",
    component: () => import("../views/topic/detail/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/category",
    name: "Category",
    component: () => import("../views/category/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/category/categorylist",
    name: "Categorylist",
    component: () => import("../views/category/categorylist/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/cart",
    name: "Cart",
    component: () => import("../views/cart/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/cart/goods",
    name: "Goods",
    component: () => import("../views/cart/components/addCart.vue"),
    meta: { isShow: false },
  },
  {
    path: "/my",
    name: "My",
    component: () => import("../views/my/index.vue"),
    meta: { isShow: true },
  },
  {
    path: "/collectlist",
    name: "Collectlist",
    component: () => import("../views/my/components//collectlist.vue"),
    meta: { isShow: false },
  },
  {
    path: "/feedback",
    name: "Feedback",
    component: () => import("../views/my/components//suggest.vue"),
    meta: { isShow: false },
  },
  {
    path: "/order",
    name: "Order",
    component: () => import("../views/order/index.vue"),
    meta: { isShow: false},
  },
  {
    path: "/addressSelect",
    name: "AddressSelect",
    component: () => import("../views/order/components/addressSelect.vue"),
    meta: { isShow: false},
  },
  {
    path: "/addressEdit",
    name: "AddressEdit",
    component: () => import("../views/order/components/addressEdit.vue"),
    meta: { isShow: false},
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
